package com.pb.web.action;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.pb.entity.District;
import com.pb.entity.House;
import com.pb.entity.Street;

public class HouseAction extends ActionSupport {

	private static final long serialVersionUID = 8860356833945086885L;

	private List<House> houses;
	private String str;

	/**
	 * 获取 str
	 * 
	 * @return str
	 */
	public String getStr() {
		return str;
	}

	/**
	 * 设置 str
	 * 
	 * @param str
	 *            str
	 */
	public void setStr(String str) {
		this.str = str;
	}

	/**
	 * 获取 houses
	 * 
	 * @return houses
	 */
	public List<House> getHouses() {
		return houses;
	}

	/**
	 * 设置 houses
	 * 
	 * @param houses
	 *            houses
	 */
	public void setHouses(List<House> houses) {
		this.houses = houses;
	}

	public String execute() {
		// 创建两个城区信息
		District district1 = new District(1, "朝阳区");
		District district2 = new District(2, "东城区");
		// 创建三条街道信息
		Street street1 = new Street(district1, 1, "朝阳1街");
		Street street2 = new Street(district2, 2, "东城1街");
		Street street3 = new Street(district2, 3, "东城2街");
		// 创建三个房屋信息
		House house1 = new House(new Date(), 1, street1, "朝阳1街的房子");
		House house2 = new House(new Date(), 2, street2, "东城1街的房子");
		House house3 = new House(new Date(), 3, street3, "东城2街的房子");

		houses = new ArrayList<House>();
		houses.add(house1);
		houses.add(house2);
		houses.add(house3);
		System.out.println(str);
		return SUCCESS;
	}

}
